<?php
/**
 * Created by PhpStorm.
 * 订单商品模块
 * User: caicm
 * Date: 2017/6/21
 * Time: 14:56
 */

namespace WMApi\Model;


use Think\Model;

class WmOrderGoodsModel extends Model {


    /**
     * 用户提交订单
     * 
     * @param array $og_data 订单商品数据;
     * 
     * @author ^2_3^
     */
    public function user_add_ogoods( $og_data=array() ) {
        return $this->addAll($og_data);
    }
    

    /**
     * 获取订单商品列表
     * Created By caicm
     * @param int $order_id
     * @return mixed
     */
    public function find_order_goods_list($order_id=0){

        $where = array(
            'order_id' => $order_id
        );

        $field = 'goods_name,goods_sn,goods_number,goods_price,total_price,goods_weight,main_attr_value_name,sec_attr_value_name';

        return $this->where($where)->field($field)->order('id desc')->select();

    }


}